﻿#region zh-CHS 2006 - 2007 DemoSoft 团队 | en 2006 - 2007 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the G.O.S.E(Game Online Server Engine) for .NET.
//
//                 2006-2007 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace
using System;
using System.Runtime.InteropServices;
using Demo_G.O.S.E.ServerEngine.Common;
#endregion

namespace Demo_G.O.S.E.ServerEngine.Network.DLL
{
    /// <summary>
    /// 客户端连接时需要的主初始化
    /// </summary>
    [MultiThreadedSupportgAttribute( "当前的类所有成员都可锁定,支持多线程操作" )]
    public class ACEClient
    {
        #region zh-CHS 共有属性 | en Public Properties
        /// <summary>
        /// 客户端的主初始化
        /// </summary>
        public static bool IsInit
        {
            get { return ACEClient.ACEClient_isInit(); }
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 客户端的初始化
        /// </summary>
        /// <param name="CLIENT_CACHED_SIZE"></param>
        /// <param name="CLIENT_BUFFER_SIZE"></param>
        /// <param name="CLIENT_MANAGE_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_SEND_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_RECEIVE_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_PROCESS_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_OUT_TIME_INTERVAL"></param>
        public static void Init(int CLIENT_CACHED_SIZE, int CLIENT_BUFFER_SIZE, int CLIENT_MANAGE_THREAD_POOL_SIZE, int CLIENT_SEND_THREAD_POOL_SIZE, int CLIENT_RECEIVE_THREAD_POOL_SIZE, int CLIENT_PROCESS_THREAD_POOL_SIZE, int CLIENT_OUT_TIME_INTERVAL)
        {
            ACEClient.ACEClient_Init(CLIENT_CACHED_SIZE, CLIENT_BUFFER_SIZE, CLIENT_MANAGE_THREAD_POOL_SIZE, CLIENT_SEND_THREAD_POOL_SIZE, CLIENT_RECEIVE_THREAD_POOL_SIZE, CLIENT_PROCESS_THREAD_POOL_SIZE, CLIENT_OUT_TIME_INTERVAL);
        }

        /// <summary>
        /// 客户端的缺省初始化
        /// </summary>
        public static void InitDefault()
        {
            ACEClient.ACEClient_InitDefault();
        }

        /// <summary>
        /// 客户端的结束
        /// </summary>
        public static void Fini()
        {
            ACEClient.ACEClient_Fini();
        }
        #endregion

        #region zh-CHS 引入DLL接口 | en DLL Import
        /// <summary>
        /// dll 调用
        /// </summary>
        /// <param name="CLIENT_CACHED_SIZE"></param>
        /// <param name="CLIENT_BUFFER_SIZE"></param>
        /// <param name="CLIENT_MANAGE_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_SEND_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_RECEIVE_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_PROCESS_THREAD_POOL_SIZE"></param>
        /// <param name="CLIENT_OUT_TIME_INTERVAL"></param>
        [DllImport("Demo G.O.S.E.Net.dll", CallingConvention = CallingConvention.StdCall)]
        private static extern void ACEClient_Init(int CLIENT_CACHED_SIZE, int CLIENT_BUFFER_SIZE, int CLIENT_MANAGE_THREAD_POOL_SIZE, int CLIENT_SEND_THREAD_POOL_SIZE, int CLIENT_RECEIVE_THREAD_POOL_SIZE, int CLIENT_PROCESS_THREAD_POOL_SIZE, int CLIENT_OUT_TIME_INTERVAL);

        /// <summary>
        /// dll 调用
        /// </summary>
        [DllImport("Demo G.O.S.E.Net.dll", CallingConvention = CallingConvention.StdCall)]
        private static extern void ACEClient_InitDefault();

        /// <summary>
        /// dll 调用
        /// </summary>
        [DllImport("Demo G.O.S.E.Net.dll", CallingConvention = CallingConvention.StdCall)]
        private static extern void ACEClient_Fini();

        /// <summary>
        /// dll 调用
        /// </summary>
        /// <returns></returns>
        [DllImport("Demo G.O.S.E.Net.dll", CallingConvention = CallingConvention.StdCall)]
        private static extern bool ACEClient_isInit();
        #endregion
    }
}
#endregion

